import Vue from 'vue'
// 导入路由
import VueRouter from 'vue-router'
// 安装
Vue.use(VueRouter)
// 导入组件
// @符号代表src
import MyHome from '@/views/MyHome.vue'
import MyLogin from '@/views/MyLogin.vue'

// 设置路由规则
const routes = [
  { path: '/home', component: MyHome },
  { path: '/login', component: MyLogin },
]

// 实例化路由对象
const router = new VueRouter({
  routes,
  // mode: 'history'
})

export default router